import locale

def fact(n):
    result=1
    for i in range(1,n+1):
        result=result*int(i)
    return result

#请在这里填写答案
n=int(input(""))
total_sum = 0
for i in range(1, n+1):
    total_sum += fact(i)
print(total_sum)